<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  <title>Create a forum</title>
  <link href="/static/default.css" rel="stylesheet" type="text/css">
  <script language="javascript" src="/static/default.js" type="text/javascript"></script>
</head>
<body>
<script>
function onUrlFieldChange() {
  var val = $("urlFieldId").value;
  $("underUrlTxt").innerHTML = "Full url: {{ hosturl }}/" + val;
  return true;
}
function onTitleFieldChange() {
  $("titleId").innerHTML = $("titleFieldId").value;
  return true;
}
function onTaglineFieldChange() {
  $("taglineId").innerHTML = $("taglineFieldId").value;
  return true;
}
function onSidebarFieldChange() {
  $("sidebarId").innerHTML = $("sidebarFieldId").value;
  return true;
}
</script>
<table>
<tbody>
  <tr>
    <td colspan="2" class="header">
      <div>
        <h1><a href="" class="green" id="titleId">{% firstof forum.title "Title." %}</a></h1>
        <p id="taglineId">{% firstof forum.tagline "Tagline." %}</p>
      </div>
    </td>
  </tr>
  <tr>
    <td class="sidebar" id="sidebarId">
      {% firstof forum.sidebar "Sidebar." %}
    </td>
    <td class="contents">
      <p>Welcome to <b><font color="blue">Fo</font></b>rums <b><font color="blue">Fo</font></b>r Yo<b><font color="blue">u</font></b>!</p>
      {% if msg %}<div class="manageforumsmsg">{{ msg }}</div>{% endif %}
 
      <p>
        {% if not forums %}
        You haven't created any forums yet.
        {% else %}
        Existing forums:
        <ul>
          {% for f in forums %}
          <li> <a href="{{ f.url }}">{% firstof f.title f.url %}</a>
            {% if f.no_edit_link %}
              edit
            {% else %}
             <a href="/manageforums?forum_key={{ f.key }}">edit</a>
            {% endif %}
            &nbsp;<a href="{{ f.enable_disable_url }}">{{ f.enable_disable_txt }}</a></li>
          {% endfor %}
        </ul>
        {% endif %}
      </p>
      <p>Create a new forum:</p>
      <form action="/manageforums" method="post">
      <table class="form">
          <tr>
            <td>Url</td>
            <td><input class="{{ urlclass }}" type="edit" size="60" maxlength="60" name="url" id="urlFieldId" onchange="return onUrlFieldChange();" onkeyup="return onUrlFieldChange();" value="{{ prevurl|escape }}"></input>
              <div>{{ errmsg }}</div>
              <div id="underUrlTxt">Full url: {{ hosturl }}/{{ forum.url }}</div>
            </td>
          </tr>
          <tr>
            <td>Title</td>
            <td><input type="edit" size="60" maxlength="128" name="title" id="titleFieldId" onchange="return onTitleFieldChange();" onkeyup="return onTitleFieldChange();" value="{{ prevtitle|escape }}"></input></td>
          </tr>
          <tr>
            <td>Tagline</td>
            <td><input type="edit" size="60" maxlength="256" name="tagline" id="taglineFieldId" onchange="return onTaglineFieldChange();" onkeyup="return onTaglineFieldChange();" value="{{ prevtagline|escape }}"></input></td>
          </tr>
          <tr>
            <td valign="top">Analytics code</td>
            <td><input type="edit" size="60" maxlength="256" name="analyticscode" value="{{ prevanalyticscode|escape }}"></input></td>
          </tr>
          <tr>
            <td valign="top">Import secret</td>
            <td><input type="edit" size="60" maxlength="256" name="importsecret" value="{{ previmportsecret|escape }}"></input></td>
          </tr>
          <tr>
            <td valign="top">Sidebar</td>
            <td><textarea name="sidebar" rows="6" cols="45" id="sidebarFieldId" onchange="return onSidebarFieldChange();" onkeyup="return onSidebarFieldChange();">{{ prevsidebar|escape }}</textarea></td>
          </tr>
          <tr>
            <td></td>
            {% if forum_key %}
              <input type="hidden" value="{{ forum_key }}" name="forum_key">
              <td align="right"><input type="submit" value="Update forum"></td>
            {% else %}
              <td align="right"><input type="submit" value="Create forum"></td>
            {% endif %}
          </tr>
      </table>
      </form>
      <p><b>Url</b> is part of the forum url. Should be short and a valid url.</p>
      <p><b>Title</b> is what we show at the top of the forum.</p>
      <p><b>Tagline</b> is shown in smaller font, under title. HTML allowed (e.g. for links).</p>
      <p><b>Analytics code</b> is Googl Analytics code. If given, key pages will include Google Analytics
          JavaScript with this code</p>
      <p><b>Import secret</b> protects bulk topic import interface.
            See <a href="http://blog.kowalczyk.info/software/fofou">docs</a> for more information</p>
      <p><b>Sidebar</b> is displayed in the left column. HTML allowed.</p>
      <p>Don't stress about choosing the right values - you can change them later.</p>
    </td>
  </tr>
</tbody>
</table>
<hr>
<center>Powered by <a href="http://blog.kowalczyk.info/software/fofou">fofou</a>
(<b><font color="blue">Fo</font></b>rums <b><font color="blue">Fo</font></b>r Yo<b><font color="blue">u</font></b>,
created by <a href="http://blog.kowalczyk.info">Krzysztof Kowalczyk</a>)</center>
<br>
</body>
</html>